﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AdmBase;

public partial class admin_pages_sustentabilidade_Default : TelaBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        IsLogado();
    }

    private SustentabilidadeBusiness sBusiness;

    public SustentabilidadeBusiness SBusiness
    {
        get
        {
            if (sBusiness == null)
                sBusiness = new SustentabilidadeBusiness();
            return sBusiness;
        }
        set { sBusiness = value; }
    }

    protected void SelectGrid(object sender, EventArgs e)
    {
        GridView grid = (GridView)sender;
        Response.Redirect("~/admin/pages/sustentabilidade/Novo.aspx?id=" + grid.SelectedValue.ToString());
    }


    protected void Deletar(object sender, EventArgs e)
    {
        int id = int.Parse(((LinkButton)sender).CommandName);

        string msg = SBusiness.Deletar(id);
        DataBind();
        GridViewSust.DataBind();
        ShowMensagem("Atenção", msg);
    }
    
}